//
//  CellForClickSearch.m
//  ProjectA
//
//  Created by dllo on 16/2/24.
//  Copyright © 2016年 刘旺辉. All rights reserved.
//

#import "CellForClickSearch.h"
#import "ModelForClickSearch1.h"
#import "ModelForClickSearch2.h"
#import "AppMacro.h"
@interface CellForClickSearch ()
@property (nonatomic, strong) UILabel *label;
@end

@implementation CellForClickSearch

- (void)dealloc {
    
    [_label release];
    [super dealloc];
    
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        self.label = [[UILabel alloc] init];
        [self.contentView addSubview:self.label];
        [_label release];
        
    }
    return self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    
    self.label.textAlignment = 1;
    self.label.numberOfLines = 1;
    self.label.font = [UIFont systemFontOfSize:13];
    self.label.layer.cornerRadius = (self.frame.size.height - 5) / 2.f;
    self.label.layer.masksToBounds = YES;
    self.label.layer.borderWidth = 1;
    self.label.frame = CGRectMake(5, 2.5, self.bounds.size.width - 10, self.bounds.size.height - 5);
    if (ISNIGHT) {
        
        self.label.layer.borderColor = [[UIColor whiteColor] CGColor];
        
    } else {
        
        self.label.layer.borderColor = [[UIColor blackColor] CGColor];
    }
    [UIView setColorWithLabelText:self.label nightColor:L_COLOR_WHITE dayColor:L_COLOR_BLACK];
//    [UIView setColorWithLabelView:self.label nightColor:L_COLOR_CLEAR dayColor:L_COLOR_CLEAR];
    
}

- (void)passModel1:(ModelForClickSearch1 *)model {
    
    
    self.label.text = model.name;
    
}
- (void)passStr:(NSString *)name {
    //self.label.frame = CGRectMake(5, 2.5, self.bounds.size.width - 10, self.bounds.size.height - 5);
    self.label.text = name;
}
- (void)passmodel2:(ModelForClickSearch2 *)model {
   // self.label.frame = CGRectMake(5, 2.5, self.frame.size.width - 10, self.frame.size.height - 5);
    self.label.text = model.name;
}
@end
